class A {
    c = 0;

    func(event) {
        event();
    }
}

class B {
    c = 1;

    func() {
        a.func(() => {
            console.log(this.c);
        })
    }
}

a = new A();
b = new B();

b.func();